<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
        <!-- 开发环境版本，包含了有帮助的命令行警告 -->
        <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <!-- 模板内容 -->
    <div id="demo">
        <p v-if="message">hello</p>
       <button @click="A()">点击我</button>
       <div v-if="type==1">A</div>
       <div v-else-if="type==2" >B</div>
       <div v-else-if="type==3" >C</div>
       <div v-else>D</div>
       <button @click="B">点击我</button>
    </div>
    <!-- js -->
    <script>
        var demo = new Vue({
            el:"#demo",
            data:{
              message:true,
              type:0
            },
            methods: {
                A:function() {
                    this.message = false;
                },
                B() {
                    if(this.type>6){
                        this.type = 1;
                    }else {
                        this.type++;
                    }
                }
            }
        })
    </script>
</body>
</html>
